/*
 * @Author: songleiluo 361215740@qq.com
 * @Date: 2024-01-01 16:40:50
 * @LastEditors: songleiluo 361215740@qq.com
 * @LastEditTime: 2024-01-14 15:58:18
 * @FilePath: \hospital\src\router\index.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { createRouter, createWebHashHistory } from "vue-router";
import NotFound from '../pages/notFond.vue';
import {layoutRoutes} from '../pages/layout/index'
let routes = [
  {
    path: '/',
    component: () => import('../pages/login.vue')
  },
  {
    path: '/login',
    component: () => import('../pages/login.vue')
  },
  
  {
    path: '/:pathMatch(.*)*', name: 'NotFound', component: NotFound
  },
]
routes=[...routes,...layoutRoutes]
console.log(routes)
const router = createRouter({
  history: createWebHashHistory(),
  routes, 
  linkActiveClass: 'router-active', // 自定义被激活路由的class类名 默认名router-link-active
  linkExactActiveClass:'router-exact-active',// 自定义精准激活router-link的class类名 默认 router-link-exact-active
})

//路由前置守卫
router.beforeEach((to, from, next) => {
  next();
})
//路由后置守卫
router.afterEach((to, from) => {

})
export default router
